﻿@model Tasks.UI.Models.SceneryModels.SeceneryLibraryManageModel
@{
    Layout = null;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>景点管理</title>
    <link href="@Config.GetCssResourcePath("main.css")" rel="stylesheet" type="text/css" />
    <link href="@Config.GetCssResourcePath("table.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Scripts/jquery-impromptu.3.1.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-impromptu.3.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/global.js")" type="text/javascript"></script>
    <style type="text/css">
        /* 搜索栏 div */
        .search
        {
            background: url(/images/inquiry_bgtop.jpg) no-repeat;
            margin-top: 10px;
            margin-bottom: 10px;
            padding: 10px 0px 0px 0px;
        }
        .search table
        {
            padding: 2px;
            width: 100%;
            background: #cbecff url(/images/inquiry_bgbottom.jpg) no-repeat 0 bottom;
        }
    </style>
    <script type="text/javascript">

        //init
        $(function () {
            datePicker("#InTime");

            initProvince("#ProvinceID");
            initCity("#CityID");

            initTable(".tblStyle1");
        })

        function setState(sceneryID, state) {
            $("#SceneryID").val(sceneryID);
            goto(state);
        }

        function goto(act) {
            $("#act").val(act);
            document.forms[0].submit();
        }
        //删除数据
        function ConfirmDel(objName, objId) {
            $.Msg.confirmDelete(
             function () {
                 $("#objID").val(objId);
                 $("#objName").val(objName);
                 $("#act").val("delete");
                 $("#form1").submit();
             }
        );
        }
    </script>
</head>
<body>
    <form id="form1" method="post" action="/SystemSetting/SceneryLibraryManage">
    <input id="objID" name="objID" type="hidden" />
    <input id="objName" name="objName" type="hidden" />
    <input id="act" name="act" type="hidden" />
    <input id="SceneryID" name="SceneryID" type="hidden" />
    <div id="container">
        <div class="navTitle">
            景点管理</div>
        <div class="searchBar">
            <table>
                <tr>
                    <td>
                        <strong>景点名称：</strong>
                        @Html.TextBoxFor(t => t.SceneryName)
                        <strong>景区级别：</strong>
                        @Html.DropDownListFor(t => t.Level, PageHelper.SceneryLevelSelector(Model.Level))
                        <strong>景点位置：</strong>
                        @Html.DropDownList("ProvinceID", PageHelper.ProvinceSelector(Model.ProvinceID))
                        @Html.DropDownList("CityID", PageHelper.CitySelector(Model.CityID, Model.ProvinceID))
                        @Html.DropDownList("AreaID", PageHelper.AreaSelector(Model.AreaID, Model.CityID))
                        <input id="Submit1" type="button" class="btnSearch" value="查询" onclick="goto('search')" />
                        <a href="javascript:void(0)" onclick="parent.addTab('添加新景点','/SystemSetting/SceneryLibraryEdit',true)">
                            添加新景点</a>
                    </td>
                </tr>
            </table>
            <div class="bottom">
            </div>
        </div>
        <div class="pageBody">
            <table class="tblStyle1" border="1" style="table-layout: fixed; width: 100%;">
                <thead>
                    <tr>
                        <th style="width: 80px;">
                            状态
                        </th>
                        <th style="width: 350px;">
                            景点名称
                        </th>
                        <th style="width: 80px;">
                            景区级别
                        </th>
                        <th style="width: 180px;">
                            景点位置
                        </th>
                        <th>
                            编号
                        </th>
                        <th>
                            操作
                        </th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (Scenery scenery in Model.Scenerys)
                    {
                        if (scenery.Contact == null)
                        {
                            scenery.Contact = new ContactInfo();
                        }
                        <tr>
                            <td>
                                @PageHelper.SceneryStateToStr(scenery.State)
                            </td>
                            <td style="text-align: left;">
                                @scenery.SceneryName
                            </td>
                            <td>
                                @scenery.Level A
                            </td>
                            <td>
                                @scenery.Contact.Position
                            </td>
                            <td>
                                @scenery.SceneryNo
                            </td>
                            <td>
                                <a href="SceneryLibraryEdit?SceneryID=@scenery.SceneryID">编辑</a> <a href="javascript:void(0);"
                                  onclick="ConfirmDel('Scenery',@scenery.SceneryID)" title="删除">删除</a>
                                @if (scenery.State == (int)SceneryState.暂停销售)
                                {
                                    <a href="javascript:;" onclick="setState(@scenery.SceneryID,'tostart')" title="状态：停用或启用">
                                        启用</a>
                                }
                                @if (scenery.State == (int)SceneryState.销售中)
                                {
                                    <a href="javascript:;" onclick="setState(@scenery.SceneryID,'blockup')" title="状态：停用或启用">
                                        停用</a>
                                }
                            </td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
        <div class="toolBar_bottom">
            @Html.RenderPageNav(Model.PageIndex, Model.PageSize, Model.RowCount, "", PageNavStyle.Form)
        </div>
    </div>
    </form>
</body>
</html>
